﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Store.aspx.cs" Inherits="H2.NET.Web.Pages.SMD.Store" %>
<%@ Register src="../../Controls/DwzAssessment.ascx" tagname="DwzAssessment" tagprefix="uc" %>
<%@ Register src="../../Controls/DwzAssessmentList.ascx" tagname="DwzAssessmentList" tagprefix="uc" %>
<%@ Register src="../../Controls/AjaxUpload.ascx" tagname="ajaxUpload" tagprefix="uc" %>
<%@ Register src="uc_search_store.ascx" tagname="uc_search_store" tagprefix="uc" %>
<%@ Register src="uc_search_dealer.ascx" tagname="uc_search_dealer" tagprefix="uc" %>
<%@ Register src="uc_search_subdealer.ascx" tagname="uc_search_subdealer" tagprefix="uc" %>
<%@ Register src="uc_search_bmc.ascx" tagname="uc_search_bmc" tagprefix="uc" %>
<%@ Register src="uc_search_accountowner.ascx" tagname="uc_search_accountowner" tagprefix="uc" %>
<%@ Register src="uc_dealer.ascx" tagname="uc_dealer" tagprefix="uc" %>
<%@ Register src="uc_head.ascx" tagname="uc_head" tagprefix="uc1" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
<head id="Head1" runat="server">
    <title>门店开店/升级/翻新/续签</title>
    <link href="<%=Page.ResolveUrl("~/Resource/Css/Style.css")%>" type="text/css" rel="stylesheet" />
    <link href="<%=Page.ResolveUrl("~/Resource/jBox/Blue/jbox.css")%>" rel="stylesheet" type="text/css" />
    <link href="<%=Page.ResolveUrl("~/Resource/Css/validform.css")%>" rel="stylesheet" type="text/css" />
    <link href="<%=Page.ResolveUrl("~/Resource/qtip/jquery.qtip.min.css")%>" rel="stylesheet" type="text/css" />
    <script src="<%=Page.ResolveUrl("~/Resource/dwz/js/jquery-1.7.2.min.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/Js/Common.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/Js/jquery.money.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/jBox/jquery.jBox-2.3.min.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/jBox/jquery.jBox-zh-CN.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/Js/Validform_v5.3.2.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/My97DatePicker/WdatePicker.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Resource/qtip/jquery.qtip.min.js")%>" type="text/javascript"></script>
    <script type="text/javascript">
        var step = "<%=TaskAPI.Step.Trim()%>";
        var isReapter = "<%=IsReapter%>";
        $(function () {
            /* 初始化相关样式、表单验证提示 st */
            $("[readonly]").addClass("readonly");
            $("[datatype='*']").after("<em class='required'>*</em>");
            $("#form1").Validform({
                //提示信息将只会在表单提交时触发显示
                tipSweep: true,
                tiptype: function (msg, o, cssctl) {
                    //msg：提示信息;
                    //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                    //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                    if (o.type == 3) {
                        $.jBox.tip(msg, 'info');
                    }
                }
            });
            /* 初始化相关样式、表单验证提示 ed */

            // 双击选择门店之后跳转的url
            $("#return_url").val('<%=Page.ResolveUrl("~/pages/smd/store.aspx?TaskID=" + TaskAPI.TaskID)%>');

            if (step == "CSM Confirm") {
                $("#uc_dealer1_dealer_id").remove();
            }



            /* 初始化控件提示 st */
            $.ajax({
                type: 'POST',
                url: '<%=Page.ResolveUrl("~/pages/smd/ajaxtools/handler.ashx?action=get_tips")%>',
                data: { pagename: 'store.aspx' },
                dataType: "json",
                cache: false,
                success: function (json) {
                    for (var o in json) {
                        var ControlID = json[o].ControlID;
                        var Content = json[o].Content;
                        $("#" + ControlID).qtip({
                            content: Content
                        });
                    }
                }
            });
            /* 初始化控件提示 ed */

            /* 授权号重复处理 st */
            $("#cb_isRepeat").change(function () {
                if ($(this).attr("checked")) {
                    $("#tb_authID_Has,#checkAuthID,#viewstore").show();
                } else {
                    $("#tb_authID_Has,#checkAuthID,#viewstore").hide();
                }
            });
            $("#viewstore").click(function () {
                $("#viewstore").attr("href", "StoreView.aspx?authid=" + $("#tb_authID_Has").val());
            });
            /* 授权号重复处理 st */

            /* 是否涉及设备 st */
            $("#cb_isDevice").change(function () {
                if ($(this).attr("checked")) {
                    $("#tb_FullSetSN").attr({ "datatype": "*", "nullmsg": "请填写固定资产号" }).after("<em class='required'>*</em>");
                    $("#ddl_Status").attr({ "datatype": "*", "nullmsg": "请选择设备状态" }).after("<em class='required'>*</em>");
                    $("#tb_BuyMachineDeposit").attr({ "datatype": "*", "nullmsg": "请填写购机款总额" }).after("<em class='required'>*</em>");
                } else {
                    $("#tb_FullSetSN,#ddl_Status,#tb_BuyMachineDeposit").removeAttr("datatype nullmsg").find("~em").remove();
                }
            });
            /* 是否涉及设备 ed */
        });

        /* 提交表单 st */
        function confirmSubmit() {
            if (isReapter == "1") {
                if (window.confirm("将以本条记录为准，覆盖原有授权号记录，确认要提交吗？")) {
                    $.jBox.tip('正在处理，请稍等...', 'loading');
                    return true;
                }
            }

            if (window.confirm("确认要提交吗？")) {
                $.jBox.tip('正在处理，请稍等...', 'loading');
                return true;
            }
            return false;
        }
        /* 提交表单 ed */

        /* 筛选相似门店 */
        function filterStroe() {
            var tb_province = $.trim($("#tb_province").val());
            if (!tb_province) {
                $.jBox.tip('请选择门店省份！');
                return false;
            }
            var ddl_cityName = $.trim($("#ddl_cityName").val());
            if (!ddl_cityName) {
                $.jBox.tip('请选择门店城市！');
                return false;
            }
            var tb_address = $.trim($("#tb_address").val());
            if (!tb_address) {
                $.jBox.tip('请填写门店地址！');
                return false;
            }
            $.jBox.tip('正在处理，请稍等...', 'loading');
            $.ajax({
                type: 'POST',
                url: '<%=Page.ResolveUrl("~/pages/smd/store.aspx?action=filterStore")%>',
                data: { province: tb_province, city: ddl_cityName, address: tb_address },
                dataType: "json",
                cache: false,
                success: function (json) {
                    var rst = json.navTabId.split("|");
                    for (var i = 0; i < rst.length; i++) {
                        if (rst[i]) {
                            var list = rst[i].split(",");
                            var html = "<tr>";
                            for (var j = 0; j < list.length; j++) {
                                html += "<td style='text-align:center'>" + list[j] + "</td>";
                            }
                            html += "</tr>";
                            $("#store_list_tbody").html(html);
                        }
                    }
                    $.jBox.closeTip();
                    $.jBox("id:store_list", {
                        title: "相似门店列表",
                        width: 800,
                        height: 500,
                        buttons: {}
                    });
                }
            });
        }

        /* 打开选择门店窗体 st */
        function openStoreDialog(obj) {
            if ($(obj).hasClass("search")) {
                $.jBox("id:search_store", {
                    title: "单击选择门店",
                    width: 650,
                    height: 500,
                    buttons: {}
                });
            }
        }

        function SearchSubdealer() {
            //var tb_province = $.trim($("#tb_province").val());
            //if (!tb_province) {
            //    $.jBox.tip('请选择门店省份！');
            //    return false;
            //}
            //var ddl_cityName = $.trim($("#ddl_cityName").val());
            //if (!ddl_cityName) {
            //    $.jBox.tip('请选择门店城市！');
            //    return false;
            //}
            $.jBox("id:search_subdealer", {
                title: "单击选择分销",
                width: 800,
                height: 500,
                buttons: {}
            });

           <%-- $.jBox.tip('正在处理，请稍等...', 'loading');
            $.ajax({
                type: 'POST',
                url: '<%=Page.ResolveUrl("~/pages/smd/store.aspx?action=searchsubdealer")%>',
                data: null ,
                dataType: "json",
                cache: false,
                success: function () {                    
                    $.jBox.closeTip();
                    $.jBox("id:serarch_subdealer", {
                        title: "单击选择分销",
                        width: 800,
                        height: 500,
                        buttons: {}
                    });
                }
            });--%>
        }



        function checkAuthId() {
            var tb_authID = $("#tb_authID");
            $.ajax({
                type: 'POST',
                url: '<%=Page.ResolveUrl("~/pages/smd/ajaxtools/handler.ashx?action=get_authId")%>',
                data: { param: $(tb_authID).val() },
                dataType: 'json',
                success: function (json) {
                    if (json.status == 'y') {
                        $.jBox.tip("授权号可使用", "success");
                    } else {
                        $.jBox.tip(json.info, "info");
                    }
                }
            });
        }

        /* 生成门店名称 st */
        $(function () {
            if (step == "Fill in the request") {
                $("#dealer_shortname,#tb_MallShortName").keyup(function () {
                    createStoreName();
                });
                $("#ddl_ShopSeq,#ddl_cityName").change(function () {
                    createStoreName();
                });
                $("#store_type").change(function () {
                    var store_type = $("#store_type option:selected").text();
                    if (store_type.indexOf("多乐士") > 0) {
                        $("#ddl_channel").find("option[value='多乐士']").attr("selected", true);
                    } else if (store_type.indexOf("来威") > 0) {
                        $("#ddl_channel").find("option[value='来威']").attr("selected", true);
                    }
                    createStoreName();
                });
            }
        });
        function createStoreName() {
            var name = "";
            name += $("#ddl_cityName").val();
            name += $("#dealer_shortname").val();
            name += $("#tb_MallShortName").val();
            var store_type = $("#store_type option:selected").text().replace("（", "(").replace("）", ")");
            name += store_type.replace("（", "(").replace("）", ")").substring(store_type.indexOf("(") + 1, store_type.indexOf(")")).replace("多乐士", "");
            name += $("#ddl_ShopSeq").val();
            $("#tb_store_name").val(name);
        }
        /* 生成门店名称 ed */

        /* 生成地址 st */
        $(function () {
            if (step == "Fill in the request") {
                $("#tb_MallName,#tb_HouseNumber").keyup(function () {
                    createAddress();
                });
                $("#ddl_cityName").change(function () {
                    createAddress()
                });
            }
        });
        function createAddress() {
            var name = "";
            name += $("#uc_dealer1_dealer_province_label").text();
            if ($("#uc_dealer1_dealer_province_label").text() != $("#ddl_cityName").val()) {
                name += $("#ddl_cityName").val();
            }
            name += $("#tb_MallName").val();
            name += $("#tb_HouseNumber").val();
            if ($("#tb_HouseNumber").val()) {
                name += "号";
            }
            $("#tb_address").val(name);
        }
        /* 生成地址 ed */

        function dealerCallBack(id) {
            var region = $("#uc_dealer1_dealer_region_label").text();
            var province = $("#uc_dealer1_dealer_province_label").text();

            $("#tb_region").val(region);
            $("#tb_province").val(province);

            $.ajax({
                type: 'POST',
                url: '<%=Page.ResolveUrl("~/pages/smd/AjaxTools/handler.ashx?action=search_city")%>',
                data: { province: province },
                cache: false,
                success: function (result) {
                    var names = result.split(",");
                    $("#ddl_cityName").html("");
                    var html = "<option value=''>==请选择==</option>";
                    for (var i = 0; i < names.length; i++) {
                        if (names[i].length > 0) {
                            html += "<option value='" + names[i] + "'>" + names[i] + "</option>";
                        }
                    }
                    $("#ddl_cityName").html(html);
                    $("#ddl_cityName").val($("#uc_dealer1_dealer_cityName_label").text());

                    createAddress();
                }
            });
        }

        function CheckFullSetSN(obj) {
            if ($(obj).val() == "") {
                return false;
            }
            $.ajax({
                type: 'post',
                url: '<%=Page.ResolveUrl("~/pages/smd/AjaxTools/handler.ashx?action=same_fullsetsn")%>',
                data: { fullSetSN: $(obj).val() },
                success: function (result) {
                    if (result == "1") {
                        $.jBox.tip('该固定资产号已存在。');
                        obj.focus();
                    }
                }
            });
        }

        function CheckEapproveSN(obj) {
            if ($(obj).val() == "") {
                return false;
            }
            $.ajax({
                type: 'post',
                url: '<%=Page.ResolveUrl("~/pages/smd/AjaxTools/handler.ashx?action=validateStoreEapproveSN")%>',
                data: { EapproveSN: $(obj).val() },
                success: function (result) {
                    if (result == "1") {
                        $.jBox.tip('该流水号已存在。');
                        obj.focus();
                    }
                }
            });
        }

        function storeCallBack(storeid, authid) {
            $("#tb_authID_Has").val(authid);
            $.jBox.close();
        }

        function checkownertype() {

            if ($("#cb_ownertype").attr("checked")) {
                $("#subdealercode").css("display", "inline");
            }
            else {
                //document.getElementById("subdealercode").style.visibility = false;
                $("#subdealercode").css("display", "none");
                $("#subdealercode").val("");
                $("#l_subdealername").html("");
            }

        }

        function SearchBMC() {
            $.jBox("id:search_bmc", {
                title: "单击选择建材市场",
                width: 800,
                height: 500,
                buttons: {}
            });
        }

        function SearchAccountOwner() {
            $.jBox("id:search_accountowner", {
                title: "单击选择负责销售",
                width: 800,
                height: 500,
                buttons: {}
            });
        }
    </script>
</head>
<body>
    <div class="flowpage">
    <form id="form1" runat="server">
        <!-- 标题 st -->
        <uc1:uc_head ID="uc_head1" runat="server" />
        <!-- 标题 ed -->

        <!-- 表单内容 st -->
        <div class="flowContent">
            <table class="formTable" style="width:100%;">
                <!-- 经销商信息 st -->
                <uc:uc_dealer ID="uc_dealer1" runat="server" />
                <!-- 经销商信息 ed -->
                
                <!-- 门店信息 st -->
                <tbody id="tbody_store" runat="server">
                    <tr>
                        <td class="title" colspan="6">门店信息（通用）</td>
                    </tr>
                    <tr>
                        <th>门店授权号：</th>
                        <td>
                            <asp:TextBox ID="tb_authid_new" runat="server"></asp:TextBox>
                            <span style="color:red"><asp:Literal ID="l_authid_new" runat="server"></asp:Literal></span>
                        </td>
                        <th><b>系统审批日期：</b></th>
                        <td>
                            <asp:TextBox ID="tb_StoreApprovedDate" runat="server" CssClass="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"></asp:TextBox>
                            <asp:Literal ID="l_StoreApprovedDate" runat="server"></asp:Literal>
                        </td>
                        <th><b>系统流水号：</b></th>
                        <td>
                            <asp:TextBox ID="tb_EapproveSN" runat="server" onblur="CheckEapproveSN(this)"></asp:TextBox>
                            <asp:Literal ID="l_EapproveSN" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:13%">门店状态：</th>
                        <td style="width:20%">
                            <asp:DropDownList ID="ddl_storeStatus" runat="server" datatype="*" nullmsg="请选择门店状态"></asp:DropDownList>
                            <asp:Literal ID="l_storeStatus" runat="server"></asp:Literal>
                        </td>
                        <th style="width:13%">门店类型：</th>
                        <td style="width:24%">
                            <asp:DropDownList ID="store_type" runat="server" datatype="*" nullmsg="请选择门店类型" Width="170px"></asp:DropDownList>
                            <asp:Literal ID="l_store_type" runat="server"></asp:Literal>
                        </td>
                        <th style="width:10%">渠道：</th>
                        <td style="width:22%">
                            <asp:DropDownList ID="ddl_channel" runat="server" datatype="*" nullmsg="请选择渠道"></asp:DropDownList>
                            <asp:Literal ID="l_channel" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>门店区域：</th>
                        <td>
                            <asp:TextBox ID="tb_region" runat="server" ReadOnly="true"></asp:TextBox>
                            <asp:Literal ID="l_region" runat="server"></asp:Literal>
                        </td>
                        <th>门店省份：</th>
                        <td>
                            <asp:TextBox ID="tb_province" runat="server" ReadOnly="true"></asp:TextBox>
                            <asp:Literal ID="l_province" runat="server"></asp:Literal>
                        </td>
                        <th>门店城市：</th>
                        <td>
                            <asp:DropDownList ID="ddl_cityName" runat="server" datatype="*" nullmsg="请选择门店城市">
                                <asp:ListItem Text="==请选择==" Value=""></asp:ListItem>
                            </asp:DropDownList>
                            <asp:Literal ID="l_cityName" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>联系人：</th>
                        <td>
                            <asp:TextBox ID="tb_ContractPerson" runat="server" datatype="*" nullmsg="请填写联系人"></asp:TextBox>
                            <asp:Literal ID="l_ContractPerson" runat="server"></asp:Literal>
                        </td>
                        <th>电话：</th>
                        <td colspan="3">
                            <asp:TextBox ID="tb_Telephone" runat="server" datatype="*" nullmsg="请填写联系电话"></asp:TextBox>
                            <asp:Literal ID="l_Telephone" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>市场/街道简称：</th>
                        <td>
                            <asp:TextBox ID="tb_MallShortName" runat="server" datatype="*" nullmsg="请填写市场/街道简称"></asp:TextBox>
                            <asp:Literal ID="l_MallShortName" runat="server"></asp:Literal>
                        </td>
                        <th>店序号：</th>
                        <td id="td_ShopSeq" runat="server">
                            <asp:DropDownList ID="ddl_ShopSeq" runat="server"></asp:DropDownList>
                            <asp:Literal ID="l_ShopSeq" runat="server"></asp:Literal>
                        </td>
                        <th id="th_NewFitment" runat="server">门店装修类型：</th>
                        <td id="td_NewFitment" runat="server">
                            <asp:Literal ID="l_NewFitment" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>门店名称：</th>
                        <td colspan="5">
                            <asp:TextBox ID="tb_store_name" runat="server" Width="500" ReadOnly="true"></asp:TextBox>
                            <asp:HiddenField ID="hd_store_id" runat="server" />
                            <asp:Literal ID="l_store_name" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>区/县/县级市：</th>
                        <td>
                            <asp:TextBox ID="tb_District" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_District" runat="server"></asp:Literal>
                        </td>
                        <th>市场/街道全名：</th>
                        <td>
                            <asp:TextBox ID="tb_MallName" runat="server" datatype="*" nullmsg="请填写建材市场/街道全名"></asp:TextBox>
                            <asp:Literal ID="l_MallName" runat="server"></asp:Literal>
                        </td>
                        <th>门牌号：</th>
                        <td>
                            <asp:TextBox ID="tb_HouseNumber" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_HouseNumber" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>门店地址：</th>
                        <td colspan="5">
                            <asp:TextBox ID="tb_address" runat="server" Width="500" datatype="*" nullmsg="请填写门店地址" ReadOnly="true"></asp:TextBox>
                            <a onclick="filterStroe()" class="u-btn" style="height:20px;padding:3px;" id="filterStore" runat="server">相似门店</a>
                            <asp:Literal ID="l_address" runat="server"></asp:Literal>
                        </td>
                    </tr>
                     <tr Style="display: none">
                        <th>是否为分销：</th>
                        <td>
                            <asp:CheckBox ID="cb_ownertype" runat="server" onchange ="checkownertype()"/>
                        </td>
                        <th>分销商编号：</th>
                        <td>
                            <asp:HiddenField ID="subdealer_id" runat="server" />
                            <asp:TextBox ID="subdealercode" CssClass ="search" runat="server" onclick ="SearchSubdealer()"></asp:TextBox>
                            <asp:Label ID="l_subdealercode" runat="server" ></asp:Label>    
                        </td>
                        <th>分销商名称：</th>
                        <td>
                            <asp:Label ID="l_subdealername" runat="server" ></asp:Label>
                        </td>
                    </tr>
                    <tr Style="display: none">
                        <th>建材市场编号：</th>
                        <td>
                            <asp:TextBox ID="bmccode" runat="server" CssClass="search" onclick ="SearchBMC()"></asp:TextBox>
                            <asp:Literal ID="l_bmccode" runat="server"></asp:Literal>
                        </td>
                        <th>建材市场名称：</th>
                        <td colspan="3">
                            <%--<asp:Literal ID="l_bmcname" runat="server" Visible ="true"></asp:Literal>--%>
                            <asp:Label ID="l_bmcname" runat="server" ></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <th>负责销售：</th>
                        <td>
                            <%--<asp:TextBox ID="tb_accountowner" runat="server"  onclick ="SearchAccountOwner()"></asp:TextBox>--%>
                            <asp:HiddenField ID="h_windowsid" runat="server" />
                            <asp:TextBox ID="tb_accountowner" runat="server" CssClass="search" onclick ="SearchAccountOwner()"></asp:TextBox>
                            <asp:Literal ID="l_accountowner" runat="server"></asp:Literal>
                        </td>
                        <th>微信公众号：</th>
                        <td colspan="3">
                            <asp:TextBox ID="tb_wechatid" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_wechatid" runat="server"></asp:Literal>
                        </td>
                    </tr>

                </tbody>
                <!-- 门店信息 ed -->
        
                <tbody id="tbody_other" runat="server">
                    <tr>
                        <td class="title" colspan="6">门店信息（DDCN&DCSS必填）</td>
                    </tr>
                    <tr>
                        <th>门店建筑面积：</th>
                        <td><asp:TextBox ID="tb_size" runat="server"></asp:TextBox>
                            <asp:Literal ID="l_size" runat="server"></asp:Literal>
                            M<sup>2</sup></td>
                        <th>最初开业时间：</th>
                        <td>
                            <asp:TextBox ID="tb_FirstStartDate" runat="server" CssClass="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM',maxDate:'%y-%M'})"></asp:TextBox>
                            <asp:Literal ID="l_FirstStartDate" runat="server"></asp:Literal>
                        </td>
                        <th>目前门店开业时间：</th>
                        <td>
                            <asp:TextBox ID="tb_CurrentStartDate" runat="server" CssClass="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM',maxDate:'%y-%M'})"></asp:TextBox>
                            <asp:Literal ID="l_CurrentStartDate" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>色彩咨询：</th>
                        <td>
                            <asp:CheckBox ID="cb_IsColourService" runat="server" />
                            <asp:Literal ID="l_IsColourService" runat="server"></asp:Literal>
                        </td>
                        <th>调色服务：</th>
                        <td>
                            <asp:CheckBox ID="cb_IsTintingService" runat="server" />
                            <asp:Literal ID="l_IsTintingService" runat="server"></asp:Literal>
                        </td>
                        <th>官网屏蔽：</th>
                        <td>
                            <asp:CheckBox ID="cb_ShowInWebsite" runat="server" Text=" 必须提交DR2审批邮件" />
                            <asp:Literal ID="l_ShowInWebsite" runat="server"></asp:Literal>
                        </td>
                    </tr>
                </tbody>
                
                <tbody id="tbody_history" runat="server">
                    <tr>
                        <td class="title" colspan="6">历史情况</td>
                    </tr>
                    <tr>
                        <th>是否为升级：</th>
                        <td><asp:CheckBox ID="cb_IsUpgraded" runat="server" />
                            <asp:Literal ID="l_IsUpgraded" runat="server"></asp:Literal>
                        </td>
                        <th>是否为降级：</th>
                        <td><asp:CheckBox ID="cb_IsDowngraded" runat="server" />
                            <asp:Literal ID="l_IsDowngraded" runat="server"></asp:Literal>
                        </td>
                        <th>是否有翻新：</th>
                        <td><asp:CheckBox ID="cb_IsRenew" runat="server" />
                            <asp:Literal ID="l_IsRenew" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <th>升级前门店类型：</th>
                        <td>
                            <asp:DropDownList ID="ddl_BeforeUpgradedType" runat="server">
                                <asp:ListItem Text="==请选择==" Value=""></asp:ListItem>
                                <asp:ListItem Text="DCSS (多乐士专卖店)" Value="DCSS"></asp:ListItem>
                                <asp:ListItem Text="DIS (多乐士形象店)" Value="DIS"></asp:ListItem>
                                <asp:ListItem Text="LIS (来威形象店)" Value="LIS"></asp:ListItem>
                            </asp:DropDownList>
                            <asp:Literal ID="l_BeforeUpgradedType" runat="server"></asp:Literal>
                        </td>
                        <th>降级前门店类型：</th>
                        <td>
                            <asp:DropDownList ID="ddl_BeforeDowngradedType" runat="server">
                                <asp:ListItem Text="==请选择==" Value=""></asp:ListItem>
                                <asp:ListItem Text="DDCN（多乐士漆彩中心店）" Value="DDCN"></asp:ListItem>
                                <asp:ListItem Text="DCSS (多乐士专卖店)" Value="DCSS"></asp:ListItem>
                                <asp:ListItem Text="LCSS (来威专卖店)" Value="LCSS"></asp:ListItem>
                            </asp:DropDownList>
                            <asp:Literal ID="l_BeforeDowngradedType" runat="server"></asp:Literal>
                        </td>
                        <th>翻新前门店类型：</th>
                        <td>
                            <asp:DropDownList ID="ddl_BeforeRenewType" runat="server">
                                <asp:ListItem Text="==请选择==" Value=""></asp:ListItem>
                                <asp:ListItem Text="DDCN（多乐士漆彩中心店）" Value="DDCN"></asp:ListItem>
                                <asp:ListItem Text="DCSS (多乐士专卖店)" Value="DCSS"></asp:ListItem>
                                <asp:ListItem Text="DIS (多乐士形象店)" Value="DIS"></asp:ListItem>
                                <asp:ListItem Text="LCSS (来威专卖店)" Value="LCSS"></asp:ListItem>
                                <asp:ListItem Text="LIS (来威形象店)" Value="LIS"></asp:ListItem>
                            </asp:DropDownList>
                            <asp:Literal ID="l_BeforeRenewType" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">&nbsp;</td>
                        <th>最新翻新时间：</th>
                        <td>
                            <asp:TextBox ID="tb_LastRenewDate" runat="server" CssClass="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM',maxDate:'%y-%M-%d'})"></asp:TextBox>
                            <asp:Literal ID="l_LastRenewDate" runat="server"></asp:Literal>
                        </td>
                    </tr>
                </tbody>

                <!-- 设备信息 -->
                <tbody id="tbody_device" runat="server">
                <tr><td colspan="6" class="title">设备信息</td></tr>
                <tr>
                    <th>是否涉及设备：</th>
                    <td id="td_isDevice" runat="server">
                        <asp:CheckBox ID="cb_isDevice" runat="server" />
                        <asp:Literal ID="l_isDevice" runat="server"></asp:Literal>
                    </td>
                    <th id="th_ApplactionType" runat="server">机器申请类型：</th>
                    <td id="td_ApplactionType" runat="server">
                        <asp:Literal ID="l_ApplactionType" runat="server"></asp:Literal>
                    </td>
                    <th id="th_MachineDeposit" runat="server">设备保证金：</th>
                    <td id="td_MachineDeposit" runat="server">
                        <asp:Literal ID="l_MachineDeposit" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <th>固定资产号：</th>
                    <td>
                        <asp:TextBox ID="tb_FullSetSN" runat="server" onblur="CheckFullSetSN(this)"></asp:TextBox>
                        <asp:Literal ID="l_FullSetSN" runat="server"></asp:Literal>
                    </td>
                    <th>设备状态：</th>
                    <td colspan="3">
                        <asp:DropDownList ID="ddl_Status" runat="server">
                            <asp:ListItem Value="" Text="==请选择=="></asp:ListItem>
                            <asp:ListItem Value="使用" Text="使用"></asp:ListItem>
                            <asp:ListItem Value="公司大仓" Text="公司大仓"></asp:ListItem>
                            <asp:ListItem Value="经销商处寄存" Text="经销商处寄存"></asp:ListItem>
                        </asp:DropDownList>
                        <asp:Literal ID="l_Status" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <th>调色机型号：</th>
                    <td>
                        <asp:DropDownList ID="ddl_dispenseModel" runat="server">
                            <asp:ListItem Value="" Text="==请选择=="></asp:ListItem>
                        </asp:DropDownList>
                        <asp:Literal ID="l_dispenseModel" runat="server"></asp:Literal>
                    </td>
                    <th>震荡机型号：</th>
                    <td>
                        <asp:DropDownList ID="ddl_shakerModel" runat="server">
                            <asp:ListItem Value="" Text="==请选择=="></asp:ListItem>
                        </asp:DropDownList>
                        <asp:Literal ID="l_shakerModel" runat="server"></asp:Literal>
                    </td>
                    <th>电脑型号：</th>
                    <td>
                        <asp:DropDownList ID="ddl_PcModel" runat="server">
                            <asp:ListItem Value="" Text="==请选择=="></asp:ListItem>
                        </asp:DropDownList>
                        <asp:Literal ID="l_PcModel" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <th>机器初购年份：</th>
                    <td>
                        <asp:TextBox ID="tb_DevicePurchasedDate" runat="server" CssClass="Wdate" onfocus="WdatePicker({dateFmt:'yyyy',maxDate:'%y'})"></asp:TextBox>
                        <asp:Literal ID="l_DevicePurchasedDate" runat="server"></asp:Literal>
                    </td>
                    <th>系统审批日期：</th>
                    <td>
                        <asp:TextBox ID="tb_DeviceStoreApprovedDate" runat="server" CssClass="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM',maxDate:'%y-%M-%d'})"></asp:TextBox>
                        <asp:Literal ID="l_DeviceStoreApprovedDate" runat="server"></asp:Literal>
                    </td>
                    <th>系统流水号：</th>
                    <td>
                        <asp:TextBox ID="tb_DeviceEapproveSN" runat="server"></asp:TextBox>
                        <asp:Literal ID="l_DeviceEapproveSN" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <th>是否为旧机更换：</th>
                                      <td>
                                          <asp:CheckBox id="cb_istransfermachine" runat="server" ></asp:CheckBox>
                                          <asp:Literal ID="l_istransfermachine" runat="server"></asp:Literal>
                                      </td>
                    <th>客户购买设备：</th>
                    <td colspan="3">
                        <asp:Literal ID="l_customerdevice" runat="server"></asp:Literal>
                    </td>
                </tr>
                </tbody>
                <!-- 设备信息 -->
                
                <!-- 需要填写的表单、相关附件 st -->
                <tbody>
                    <tr>
                        <td class="title" colspan="6">填写信息</td>
                    </tr>
                    <tr id="tr_authId" runat="server" style="display:none">
                        <th style="color:red;">门店授权号：</th>
                        <td colspan="5">
                            <asp:TextBox ID="tb_authID" runat="server"></asp:TextBox>
                            <asp:HiddenField ID="hf_authID" runat="server" />
                            <asp:CheckBox ID="cb_cover" runat="server" Text="覆盖" Visible="false" />
                            <a href="javascript:;" onclick="checkAuthId(this)" id="checkAuthID" runat="server" visible="false">检验授权号是否重复</a>

                            <asp:CheckBox ID="cb_isRepeat" runat="server" Text="是否有相似门店" Visible="false" />
                            <asp:TextBox ID="tb_authID_Has" runat="server" style="display:none" CssClass="search" onclick="openStoreDialog(this)"></asp:TextBox>
                            <a id="viewstore" target="_blank" style="display:none" href="javascript:;">点击查看门店详细信息</a>
                        </td>
                    </tr>
                    <tr>
                        <th>相关附件：</th>
                        <td colspan="5">
                            <uc:ajaxUpload ID="ajaxUpload1" runat="server" />
                        </td>
                    </tr>
                </tbody>
                <!-- 需要填写的表单、相关附件 ed -->
                

                <!-- 审批列表 st -->
                <tbody id="assessment" runat="server" visible="false">
                    <tr>
                        <td class="title" colspan="6">审批列表</td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <uc:DwzAssessmentList ID="DwzAssessmentList1" runat="server" />
                        </td>
                    </tr>
                </tbody>
                <!-- 审批列表 ed -->
                <!-- 审批意见 st -->
                <tbody>
                    <uc:DwzAssessment ID="DwzAssessment1" runat="server" />
                </tbody>
                <!-- 审批意见 ed -->
            </table>
        <%  if(H2.NET.Common.AksRequest.GetString("showbtn") != "0")
            { %>
            <div class="flowBtns">
                <asp:Button ID="btn_submit" runat="server" CssClass="u-btn" Text="提交(Submit)" OnClick="btn_submit_Click" OnClientClick="return confirmSubmit();" />
                <input type="button" class="u-btn u-btn-c4" value="关闭(Close)" onclick="custom_close()" />
                <asp:HyperLink ID="hl_ExportPdf" runat="server" Visible="false" Target="_blank" CssClass="u-btn u-btn-c3" style="height:28px; line-height:28px; display:inline-block;">生成(PDF)</asp:HyperLink>
                <asp:Button ID="btn_print" runat="server" CssClass="u-btn u-btn-c2" Text="打印(Print)" OnClientClick="window.print()" Visible="false" />
            </div>
        <%  } %>
        </div>
        <!-- 表单内容 ed -->
    </form>
    </div>

    <div class="dialog_content" id="store_list" style="display:none;">
    <table class="htable">
        <thead>
            <tr>
                <th>门店授权号</th>
                <th>门店名称</th>
                <th>门店区域</th>
                <th>门店省份</th>
                <th>门店城市</th>
                <th>门店地址</th>
                <th>联系人</th>
                <th>状态</th>
                <th>类型</th>
                <th>相似度(%)</th>
            </tr>
        </thead>
        <tbody id="store_list_tbody">
            
        </tbody>
    </table>
</div>
<div id="search_store" style="display:none;">
    <input type="hidden" id="RestrictDealer" name="RestrictDealer" value="false" />
    <uc:uc_search_store ID="uc_search_store1" runat="server" />
</div>

<div id="search_subdealer" style="display:none;">
    <uc:uc_search_subdealer ID="uc_search_subdealer1" runat="server" />
</div>
<div id="search_bmc" style="display:none;">
    <uc:uc_search_bmc id="uc_search_bmc1" runat="server" />
</div>
<div id="search_accountowner" style="display:none;">
    <uc:uc_search_accountowner id="uc_search_accountowner1" runat="server"></uc:uc_search_accountowner>
</div>
    
    
<!--已用门店授权号弹出窗口-->
<div id="authId_list" style="display: none;">
    <div class="dialog_content">
        <table class="htable">
            <thead>
                <tr>
                    <th>区域</th>
                    <th>门店类型</th>
                    <th>授权号</th>
                </tr>
            </thead>
            <tbody id="dialog_tbody">
            </tbody>
        </table>
    </div>
</div>
    

</body>
</html>

